import json


def writejson(dict, jsonname):
    try:
        with open(f"{jsonname}", "w+")as f:  # 写入json文件
            f.write(json.dumps(dict))
            f.close()
    except Exception as e:
        print(e)
        pass

def readjson(jsonname):
    with open(f"{jsonname}", "r")as f:
        cookies = json.loads(f.readline())
    return cookies